import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import replace from '@rollup/plugin-replace'

module.exports = {
    input: 'sw.js',
    output: {
        file: 'service-worker.js',
        format: 'umd',
        name: "SW"
    },
    plugins: [
        resolve(),
        replace({
            preventAssignment: true,
            values: {
                'process.env.NODE_ENV': JSON.stringify('production'),
            }
        }),
        commonjs(),
        json()
    ]
}